﻿using System;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Text;


namespace SharpCommunications.Interfaces
{
    public delegate void ReceivedMessageHandlerDelegate(ISharpConnectionEndpoint connectionEndpoint, string message);
    public delegate void DisconnectedHandlerDelegate(ISharpConnectionEndpoint connectionEndpoint);

    public interface ISharpConnectionEndpoint : IDisposable
    {
        event ReceivedMessageHandlerDelegate ReceivedMessage;
        event DisconnectedHandlerDelegate Disconnected;

        void Initialize(TcpClient tcpClient);

        string ReceiveMessage();
        void SendMessage(string message);

        void Close();
    }
}
